package com.qzsf.backend.entity;

import com.qzsf.backend.dto.UserDetailDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.Year;

/*
 * @Author: Dennis Chen
 * @CreateTime: 2024/10/30 16:27 周三
 * @Email 1429278462@qq.com
 * @Remark 用户详细资料实体类
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserProfile implements Serializable {
    private int id;
    private String name;
    private String pic;
    private String sex;
    private String phone;
    private String email;
    private String address;
    private String studentId;
    private Year enrollmentYear;
    private String faculty;

    public UserProfile(int id, UserDetailDTO userDetailDto){
        this.id = id;
        this.name = userDetailDto.getName();
        this.pic= userDetailDto.getPic();
        this.sex = userDetailDto.getSex();
        this.phone = userDetailDto.getPhone();
        this.email = userDetailDto.getEmail();
        this.address = userDetailDto.getAddress();
        this.studentId = userDetailDto.getStudentId();
        this.enrollmentYear = userDetailDto.getEnrollmentYear();
        this.faculty = userDetailDto.getFaculty();
    }
}
